﻿using System;
using System.Collections.ObjectModel;
using System.Xml.Serialization;

namespace NetBay.Core.BusinessEntities.Workflow.Rules
{
    [XmlTypeAttribute(AnonymousType = true, TypeName = "Action")]
    [Serializable]
    public class Action
    {
        [XmlArray("Conditions")]
        [XmlArrayItem("Condition")]
        public ObservableCollection<Condition> Conditions { get; set; }

        [XmlAttributeAttribute]
        public long Identifier { get; set; }

        [XmlAttributeAttribute]
        public WorkflowTypeAction UiTypeAction { get; set; }

        [XmlAttributeAttribute]
        public SelectionMode ValidatingMode { get; set; }

        [XmlAttributeAttribute]
        public WorkflowState ValidatingState { get; set; }

        [XmlAttributeAttribute]
        public bool IsOption { get; set; }

        [XmlAttributeAttribute]
        public bool IsSenderOnly { get; set; }

        [XmlArray("ActionParameters")]
        [XmlArrayItem("ActionParameter")]
        public ObservableCollection<ActionParameter> ActionParameters { get; set; }
    }
}
